import Vue from 'vue'
import VueRouter from 'vue-router'
import IndexView from "@/views/index/IndexView";
import HomeView from "@/views/home/HomeView";
import Goods from "@/views/goods/IndexView"
import BrandView from "@/views/goods/BrandView";
import SpecView from "@/views/goods/SpecView";
import ItemcatView from "@/views/goods/ItemcatView";
import TemplateView from "@/views/goods/TemplateView";
import GoodsView from "@/views/goods/GoodsView";
import LoginView from "@/views/LoginView";

import Business from "@/views/goods/BusinessView"
import AuditView from "@/views/goods/AuditView"

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: IndexView,
    children:[
      {
        path: '/',
        name: 'home',
        component: HomeView
      },
      {
        path: '/business',
        name: 'business',
        component: Business,
        children: [
          {
            path: "audit",
            name: "audit",
            component: AuditView
          },
        ]
      },

      {
        path: '/goods',
        name: 'goods',
        component: Goods,
        children: [
          {
            path: "brand",
            name: "brand",
            component: BrandView
          },
          {
            path: "spec",
            name: "spec",
            component: SpecView
          },
          {
            path: "itemcat",
            name: "itemcat",
            component: ItemcatView
          },
          {
            path: "template",
            name: "template",
            component: TemplateView
          },
          {
            path: "goods",
            name: "goods",
            component: GoodsView
          }
        ]
      }
    ]
  },
  {
    path: "/login",
    component: LoginView
  }

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
